<?php
namespace app\common\model\shop\ozon;

use think\admin\Model;

/**
 * OzonGoodsSkuModel
 * ozon商品SKU
 * @Description
 * @package app\common\model\shop\ozon
 * @author wangqinghui
 * @date 2024-11-01 09:29
 */
class OzonGoodsSkuModel extends Model
{
    // 设置当前模型对应的完整数据表名称
    protected $name = 'shop_goods_sku_ozon';

    // 自动写入时间戳
    protected $autoWriteTimestamp = false;

    /**
     * 日志名称
     * @var string
     */
    protected $oplogName = 'ozon商品SKU';

    /**
     * 日志类型
     * @var string
     */
    protected $oplogType = 'ozon商品SKU管理';


    /**
     * 推送状态
     * @Description
     * @author wangqinghui
     * @date 2024-12-14 17:46
     * @return array
     */
    public static function pushStatusArr() : array
    {
        return [0 => lang('未推送'), 1 => lang('推送处理中'), 2 => lang('推送成功'), 3 => lang('推送失败')];
    }

    /**
     * sku库存数据关联
     * @Description
     * @author wangqinghui
     * @date 2024-12-24 17:32
     * @return \think\Model\relation\HasMany
     */
    public function stockData(): \think\Model\relation\HasMany
    {
        return $this->hasMany(OzonGoodsSkuStockModel::class,'goods_nu','goods_nu');
    }
}